<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "help".
 *
 * @property integer $id
 * @property integer $cid
 * @property string $message
 */
class Help extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'help';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cid', 'message'], 'required'],
            [['cid'], 'integer'],
            [['message'], 'string'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'cid' => '所属栏目',
            'message' => '内容',
        ];
    }
    public function getHelpColumn(){
        return $this->hasOne(HelpColumn::className(), ['id'=>'cid']);
    }
}
